package com.sca.bussiness.controller;

import com.sca.bussiness.entity.api.BaseResult;
import com.sca.bussiness.service.SeataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuxianfei
 * @since 2020/11/13 16:57
 */
@Api
@RestController
@RequestMapping("/bussiness/v1")
public class SeataController {

    private final SeataService seataService;

    public SeataController(SeataService seataService) {
        this.seataService = seataService;
    }

    @GetMapping("/test")
    @ApiOperation("seata test")
    public BaseResult<?> test(Integer userId, Long goodId) throws Exception {
        seataService.testSeataMethod(userId, goodId);
        return new BaseResult<>();
    }

}
